package com.deyinet.bdcms.service.impl;


import com.deyinet.bdcms.core.dao.Dao;
import com.deyinet.bdcms.core.service.impl.BaseServiceImpl;
import com.deyinet.bdcms.core.vo.Page;
import com.deyinet.bdcms.dao.ILogsDao;
import com.deyinet.bdcms.entity.Syslog;
import com.deyinet.bdcms.service.ILogsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Timestamp;
import java.util.List;

/**
 * Created by Bacel on 2017/04/16.
 */
@Service
public class LogsService extends BaseServiceImpl<Syslog> implements ILogsService {

    @Autowired
    private ILogsDao moduleDao;

    @Override
    protected Dao getDao() {
        return moduleDao;
    }

    @Override
    public void findByExampleLike(Syslog example, Page<Syslog> page, Timestamp beginTime, Timestamp endTime) {
        List<Syslog> list=moduleDao.findByExampleLike(example,page.getPageCurrent(),page.getPageSize(),beginTime,endTime);
        long count = moduleDao.countByExampleLike(example,beginTime,endTime);
        page.setList(list);
        page.setTotalRow(Long.valueOf(count));
    }
}